package com.demo.io.characterstream;

import org.junit.jupiter.api.Test;

import java.io.FileReader;
import java.io.IOException;

/**
 * @author wangning
 * @date 2023/12/22 16:04
 * @description
 */
public class FileReaderTest {
    @Test
    public void test01() {
        try (FileReader fileReader = new FileReader("src/main/resources/file/file_reader.txt")) {
            int content;
            long skip = fileReader.skip(3);
            System.out.println("The actual number of bytes skipped:" + skip);
            System.out.print("The content read from file:");
            while ((content = fileReader.read()) != -1) {
                System.out.print((char) content);
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

}
